home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Apple Reference & Present…ry 5: (Reseller Edition)
/
Apple Reference & Presentations Library 5.0 (Reseller Edition).iso
/
5-Fonts & Software
/
HyperCard 1.2.5
/
Help Stacks
/
Help
/
card_63765.txt
< prev
next >
Wrap
Text File
|
1987-11-25
|
2KB
|
114 lines
-- card: 63765 from stack: in
-- bmap block id: 0
-- flags: 0000
-- background id: 4507
-- name:
-- part 2 (button)
-- low flags: 00
-- high flags: 8004
-- rect: left=422 top=85 right=107 bottom=495
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: Example 1
----- HyperTalk script -----
on mouseUp
--An example of an IF THEN ELSE control structure
If the shiftKey is down then play "boing"
edit script of card button "example 1" --so you can see the script
end mouseUp
-- part 3 (button)
-- low flags: 00
-- high flags: 8004
-- rect: left=420 top=151 right=173 bottom=495
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: Example 2
----- HyperTalk script -----
on mouseUp
--An example of an IF THEN ELSE control structure
If the shiftKey is down
then play "boing"
else put "the shift key is up"
edit script of card button "example 2" --so you can see the script
end mouseUp
-- part 4 (button)
-- low flags: 00
-- high flags: 8004
-- rect: left=419 top=222 right=244 bottom=495
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: Example 3
----- HyperTalk script -----
on mouseUp
--An example of a REPEAT control structure
ask "How many boings?" with 2
if it < 0 then exit mouseUp --no negative numbers
repeat for it
play "boing" ge.
end repeat
edit script of card button "example 3" --so you can see the script
end mouseUp
-- part contents for background part 1
----- text -----
If <true or false expression> then <command>
-- only one command in the "then" clause
If <true or false expression>
then <command> -- single command only
else <command> -- single command only
-- no "end if"
repeat [for] <number of times>
<command>
<command>
end repeat
-- part contents for background part 2
----- text -----
Other control structures (cont.)
-- part contents for background part 44
----- text -----
if...then
if...
then...
else...
repeat for
-- part contents for background part 43
----- text -----
267,189